package edu.sjsu.cs.gui;

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class ButtonViewer
{
   public static void main(String[] args)
   {
     final String FRAME_TITLE = "Frame with components";
     final int FRAME_WITH = 300;
     final int FRAME_HEIGHT = 400;
     
     JFrame frame = new JFrame();
     frame.setTitle(FRAME_TITLE);
     frame.setSize(FRAME_WITH, FRAME_HEIGHT);
     frame.setLocationRelativeTo(null);
     
     
     frame.setLayout(new FlowLayout());
     
     JLabel label = new JLabel("click!");
     
     JButton button1 = new JButton("OK");
     
     frame.add(label);
     frame.add(button1);
     
     
     ButtonListener listener = new ButtonListener(label);
     button1.addActionListener(listener);
     
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     frame.setVisible(true);
   }

}
